#include <stdio.h>
#include <string.h>
#include <stdlib.h>

int main()
{
    struct problem
    {
        char a;
        char n1[99999];
        char n2[99999];
        char n3[99999];
    }stp[51];
    
    int n,i,l;
    scanf("%d",&n);
    getchar();
    for(i=0;i<n;i++)
    {
        scanf("%c %s %s",&stp[i].a,&stp[i].n1,&stp[i].n2);
        if((stp[i].a<'a' && stp[i].a>'z'))
            stp[i].a=stp[i-1].a;
    }

    for(i=0;i<n;i++)
    {
        if(stp[i].a=='a')
        {
            int a1=strtol(stp[i].n1, NULL, 10);
            int a2=strtol(stp[i].n2, NULL, 10);
            int a3=a1+a2;
            sprintf(stp[i].n3,"%c",a3);
            l=strlen(stp[i].n1)+strlen(stp[i].n2)+strlen(stp[i].n3)+2;
            printf("%s+%s=%s\n%d\n",stp[i].n1,stp[i].n2,stp[i].n3,l);
        }
        
    }

    return 0;
}